package com.example.demo.controller;

import com.example.demo.pojo.Book;
import com.example.demo.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("book")
@RestController
public class BookController {

    @Resource
    private BookService bookService;

    @RequestMapping("bug_book/{bookId}/{num}")
    @ResponseBody
    public String test(@PathVariable("bookId") Integer bookId,
                       @PathVariable("num") Integer num
                       ){

        bookService.bugBook(new Book(bookId, num));
        return "";
    }

}
